#!/bin/bash

# 源文件路径
SRC_DIR="../../src"

# 优化锁实现
optimize_locks() {
    echo "Optimizing locks..."
    for file in $SRC_DIR/locks/*.c; do
        echo "Processing $file"
        vsyncer optimize -A -1 "$file"
    done
}

# 优化无锁数据结构
optimize_lockfree() {
    echo "Optimizing lock-free structures..."
    for file in $SRC_DIR/{queue,stack}/*.c; do
        echo "Processing $file"
        vsyncer optimize -A -1 "$file"
    done
}

# 主函数
main() {
    optimize_locks
    optimize_lockfree
}

main 